package com.izliang.gateway.controller;


import com.alibaba.fastjson.JSONObject;
import com.izliang.gateway.client.user.UserClient;
import model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import res.Result;

@RestController
@RequestMapping(value ="/user")
public class UserController {

    @Autowired
    private UserClient userClient;

    @RequestMapping(value = "/info")
    public JSONObject info(int id){
        User user = userClient.getUser(id);
        return Result.Result(200,"success",user);
    }

}
